package com.dddexplained.designbootcamp.designpatterns.state.device.after;

public class MasterBoardUshellState extends DeviceState {
    @Override
    public void gotoInitial() {
        exitUshell();
        logout();
        service.setCurrentState(new InitialState(service));
    }

    @Override
    public void gotoMasterBoardShell() {
        exitUshell();
        service.setCurrentState(new MasterBoardShellState(service));
    }

    @Override
    public void gotoMasterBoardUshell() {
        // do nothing
    }

    @Override
    public void gotoSlaveBoardShell() {
        exitUshell();
        enterSlaveBoard();
        service.setCurrentState(new SlaveBoardShellState(service));
    }

    @Override
    public void gotoSlaveBoaardUshell() {
        exitUshell();
        enterSlaveBoard();
        enterUshell();
        service.setCurrentState(new SlaveBoardUshellState(service));
    }

    public MasterBoardUshellState(TelnetService service) {
        super(service);
        System.out.println("In Master Board with Ushell");
    }
}
